
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/pub/head_latest.inc"%>
	<script type="text/javascript" src="${baseURL }/themes/plugin/aes/aes.js"></script>
	<script type="text/javascript" src="${baseURL }/themes/plugin/aes/pad-iso10126-min.js"></script>
	<script type="text/javascript" src="${baseURL }/themes/plugin/aes/aesUtil.js"></script>
<title>修改密码</title>
<style>
body {
	padding: 0;
	text-align: center;
}
.l-form{
	display: inline-block;
	width: 400px;
	height: 300px;
	padding: 10px;
	background: #fff;
	margin-top: 100px;
}
.l-form>h2{
	letter-spacing: 2px;
	margin: 10px auto;
}
.blue-btn{
	background: #2684ce;
    border: 0px;
    color: #fff;
    height: 40px;
    font-size: 16px;
    font-family: "微软雅黑";
    text-align: center;
    width: 80px;
    border-radius: 4px;
}
.margin-20{
	margin: 20px 30px;
	text-align: right;
}
.l-table-edit-td{
	height: 40px;
}
</style>
</head>
<body>
 	<form name="form1" method="post" id="form1" target="" action="${baseURL}/system/security/logon/updatePassword.do">
		<h2>修改密码</h2>
		<table id="psdChange" cellpadding="0" cellspacing="0" class="l-table-edit">
			<tr>
				<td align="right" class="l-table-edit-td" >
					当前密码
				</td>
				<td align="left" class="l-table-edit-td"><input
					name="password" type="password" id="password" ltype="text"
					validate="{required:true,minlength:3,maxlength:50}" inputwidth="300"/></td>
				<td align="left"></td>
			</tr>
			<tr>
				<td align="right" class="l-table-edit-td">新密码
				</td>
				<td align="left" class="l-table-edit-td"><input
					name="passwordNew" type="password" id="passwordNew" ltype="text"
					validate="{required:true,minlength:6}" inputwidth="300"/></td>
				<td align="left"></td>
			</tr>
			<tr>
				<td align="right" class="l-table-edit-td">确认新密码
				</td>
				<td align="left" class="l-table-edit-td"><input
					name="passwordOk" type="password" id="passwordOk" ltype="text"
					validate="{required:true,minlength:6}" inputwidth="300"/></td>
				<td align="left"></td>
			</tr>
		</table>
		<div class="margin-20">
			<button type="button" class="blue-btn" id="submitForm" onclick="FF_Save()">提交</button>
		</div>
	</form>
	<script type="text/javascript">
		$("#form1").ligerForm();
		LG.validate($("#form1"));
 		//保存
		function FF_Save() {
			var password = $("#password").val();
			var passwordNew = $("#passwordNew").val();
			var passwordOk = $("#passwordOk").val();
			
			if(password != '' )
				password = aesEncrypt(password);
			
			if(passwordNew != '' )
				passwordNew = aesEncrypt(passwordNew);
			
			if(passwordOk != '' )
				passwordOk = aesEncrypt(passwordOk);

			var win = parent || window;
			 
			var url = "${baseURL}/system/security/logon/updatePassword.do";
			$.ajax({
				type : "post",
				url : url,
				dataType : "text",
				data:{password:password,passwordNew:passwordNew,passwordOk:passwordOk},
				beforeSend : function() {
					LG.loading = true;
					LG.showLoading('正在处理中...请稍候');
				},
				complete : function() {
					LG.loading = false;
					LG.hideLoading();
				},
				success : function(msg) {
					if (msg == "修改成功！") {
						win.$.ligerDialog.success("修改成功！");
						win.LG.closeCurrentTab("updatePassword");
					} else {
						win.$.ligerDialog.warn(msg);
					}
				}
			});
		}

		//取消按钮，即关闭窗体
		function FF_Cancel() {
			var win = parent || window;
			win.LG.closeCurrentTab("updatePassword");
		}
	</script>
</body>
</html>